﻿using System.ComponentModel.Design;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System;
using System.Windows.Forms;

namespace UtfprLibrary.Windows.Forms.ComponentModel {
    internal class UtfprGroupBoxActionList : UtfprActionListBase {
        private readonly UtfprGroupBoxBase linkedControl;

        public UtfprGroupBoxActionList(UtfprGroupBoxBase component, ControlDesigner designer)
            : base(component, designer) {
                linkedControl = (UtfprGroupBoxBase)LinkedControl;
        }

        #region Properties

        [DefaultValue(null)]
        [Bindable(true, BindingDirection.OneWay)]
        [TypeConverter("System.Windows.Forms.Design.DesignBindingConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
        [Editor("System.Windows.Forms.Design.DesignBindingEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public object ValueField {
            get { return GetBind("ValueField"); }
            set { SetBind("ValueField", value, "ValueField"); }
        }

        #endregion

        #region Override

        public override DesignerActionItemCollection GetSortedActionItems() {
            var items = new DesignerActionItemCollection();
            
            items.Add(new DesignerActionHeaderItem("Dados"));

            items.Add(new DesignerActionPropertyItem(
                "ValueField", "ValueField", "Dados", "Escolha o campo a ser salvo."));

            return items;
        }

        #endregion
    }
}
